package EvaTCPL;

public class EvaTCPLrndclass extends EvaTCPLaexpression
{
  String identifier;

  public EvaTCPLrndclass(String theidentifier)
    {
      super();
      identifier = theidentifier;
    }

  /** Evaluate this arithmetic expression. */
  public double evaluate()
    {
      int s0, s1;
      s0 = (int)sons[0].evaluate();
      s1 = (int)sons[1].evaluate();

      return  (((int)Math.rint((s1-s0)*Math.random()))%(s1-s0))+s0;
    }

  public String toString()
    {
      return "rndclass("+identifier+")";
    }

}
